Skip to content

Fixed bug of scheduler generated events overlapping with scheduled events#120

Merged
trappaly merged 1 commit intodevelopmentfrom
fix/scheduler-overlapping-events
May 11, 2025
Merged

Fixed bug of scheduler generated events overlapping with scheduled events#120
trappaly merged 1 commit intodevelopmentfrom
fix/scheduler-overlapping-events

Conversation

@tyu012
Copy link
Copy Markdown
Collaborator

@tyu012 tyu012 commented May 11, 2025

Fixed minutesToNextEvent function which was non-functional. The bug led to all generated events having the same length. Now it aligns with the actual amount of minutes the user has available, so there isn't overlap.

Relevant information could be found on Trello: https://trello.com/c/H1a54YOH/200-debug-events-generated-are-not-across-all-free-time-block-sometimes-overlap-pre-existing-events

const dayEnd = userPreferences.endTime;
const futureEvents = events
const minutesToDayEnd = dayEnd - currentMinutes;
const dayEndDate = new Date(time.getTime() + minutesToDayEnd * 60000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed ending times for events

if (futureEvents.length > 0) {
return (
UserPreferenceUtils.dateToMinuteNumber(futureEvents[0].start_time) -
currentMinutes
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed future events to future events on this day

Copy link
Copy Markdown
Collaborator

@trappaly trappaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the bug of changing the minutes to next event in the scheduling algorithm

@trappaly trappaly merged commit 8f78f76 into development May 11, 2025
1 check passed
@trappaly trappaly deleted the fix/scheduler-overlapping-events branch May 14, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants